package com.android.basemvvm.click

object GlobalClickTime {
    /**
     * 两次点击间隔不能少于 600ms
     */
    private const val FAST_CLICK_DELAY_TIME = 600
    private var lastClickTime: Long = 0

    fun isFastClick(): Boolean {
        var flag = true
        val currentClickTime = System.currentTimeMillis()
        if (currentClickTime - lastClickTime >= FAST_CLICK_DELAY_TIME) {
            flag = false
            lastClickTime = currentClickTime
        }
        return flag
    }

}